{* 
	�������-��������� ��� ������������ ������ � ������� �������� 
	�� �������� � �������������� ������� � ����������� �� ���� ������� � ���
*}

{function name="link4edit"}
	{foreach from=","|explode:$data.categories item=category}
		{if $Acl.mvc.control.$controller.edit && $Acl.categories.$category|in_array:["editself","deleteself","edit","delete","full"]}
			{if $Acl.categories.$category=="editself" && $data.creator!=$UserData.userid}
				{break}
			{elseif $Acl.categories.$category=="deleteself" && $data.creator!=$UserData.userid}
				{break}
			{else}
				<a href="/control/{$controller}/edit/resourceid/{$data.resourceid}/" title="�������������"><img src="/images/control/icons/page_edit.png" width="16" height="16" border="0" alt="" /></a>
				{break}
			{/if}
		{/if}
	{/foreach}
{/function}


{function name="link4delete"}
	{foreach from=","|explode:$data.categories item=category}
		{if $Acl.mvc.control.$controller.delete && $Acl.categories.$category|in_array:["deleteself","edit","delete","full"]}
			{if $Acl.categories.$category=="deleteself" && $data.creator!=$UserData.userid}
				{break}
			{else}
				<a href="/control/{$controller}/delete/resourceid/{$data.resourceid}/" title="�������" onclick="return confirm('�� ������������� ������ ������� ������?')"><img src="/images/control/icons/cross.png" width="16" height="16" border="0" alt="" /></a>
				{break}
			{/if}
		{/if}
	{/foreach}
{/function}


{* ������� ������ ��������� �� ������� *}

{function name="ErrorsMessages"}
	{if $Errors}
		<div class="ui-phorm-warnings ui-state-error ui-corner-all">
			<span class="ui-icon ui-icon-alert"></span>
			<ul>
				{foreach from=$Errors item=data}
					{if $data|is_array}
						{foreach from=$data item=rec}
							<li>{if $rec|is_array}{"</li><li>"|implode:$rec}{else}{$rec}{/if}</li>
						{/foreach}
					{else}
						<li>{$data}</li>
					{/if}
				{/foreach}
			</ul>
		</div>
		<div class="clear"></div>
	{/if}
	{if $Success}
		<div class="ui-phorm-warnings ui-state-highlight ui-corner-all">
			<span class="ui-icon ui-icon-info"></span>
			<ul>
				{foreach from=$Success item=data}
					{if $data|is_array}
						{foreach from=$data item=rec}
							<li>{if $rec|is_array}{"</li><li>"|implode:$rec}{else}{$rec}{/if}</li>
						{/foreach}
					{else}
						<li>{$data}</li>
					{/if}
				{/foreach}
			</ul>
		</div>
		<div class="clear"></div>
	{/if}
	{if $Warnings}
		<div class="ui-phorm-warnings ui-state-highlight ui-corner-all">
			<span class="ui-icon ui-icon-info"></span>
			<ul>
				{foreach from=$Warnings item=data}
					{if $data|is_array}
						{foreach from=$data item=rec}
							<li>{if $rec|is_array}{"</li><li>"|implode:$rec}{else}{$rec}{/if}</li>
						{/foreach}
					{else}
						<li>{$data}</li>
					{/if}
				{/foreach}
			</ul>
		</div>
		<div class="clear"></div>
	{/if}
{/function}

